import Vue from "vue";
import VueRouter from "vue-router";
import Layout from '@/layout';

Vue.use(VueRouter);
const RouterView = () => import('@/components/RouterView') // 路由视图
const PATH_ROOT = '/App';

// 主页面路由
const USER_ROUTER = [
    //用户管理
    {
        path: '/SysMgmt',
        component: Layout,
        meta: { title: '系统管理', hidden: false, icon: { name: 'user', type: 'png' }, redirect: 'noRedirect' },
        redirect: '/UserMgmt',
        children: [
            //用户中心
            {
                path: '/UserMgmt',
                meta: { title: '用户管理', hidden: false, icon: { name: 'el-icon-user-solid', type: 'elementUI' } },
                component: RouterView,
                children: [
                    {
                        path: PATH_ROOT + '/SysMgmt/UserMgmt/UserCenter',
                        meta: { title: '用户中心', hidden: false, icon: { name: 'el-icon-user-solid', type: 'elementUI' } },
                        component: () => import('@/views/App/SysMgmt/UserMgmt/UserCenter.vue'),
                    },
                    //权限树
                    {
                        path: PATH_ROOT + '/SysMgmt/UserMgmt/AuthTree',
                        meta: { title: '权限树', hidden: true, icon: { name: 'el-icon-s-help', type: 'elementUI' } },
                        component: () => import('@/views/App/SysMgmt/UserMgmt/AuthTree.vue'),
                    },
                ]
            },
            //权限中心
            {
                path: '/AuthMgmt',
                meta: { title: '权限管理', hidden: false, icon: { name: 'el-icon-menu', type: 'elementUI' } },
                component: RouterView,
                children: [
                    {
                        path: PATH_ROOT + '/SysMgmt/AuthMgmt/AppCenter',
                        meta: { title: '应用中心', hidden: false, icon: { name: 'el-icon-user-solid', type: 'elementUI' } },
                        component: () => import('@/views/App/SysMgmt/AuthMgmt/AppCenter.vue')
                    },
                ]
            },
        ]
    },

];

export default USER_ROUTER;
